import { assetManager, instantiate, Prefab, size, UITransform } from "cc";
import { loadAysnc } from "./UILoadHelper";
import { UIManager } from "./UIManager";
import { UIReference } from "./UIReference";

export abstract class UIBase<T extends UIReference> {
    protected _inited: boolean = false;
    public get inited(): boolean {
        return this._inited;
    }
    public content: T;
    public async init() {
        this._inited = true;
    }
    public async show() {
        this.content.node.active = true;
    }
    public async hide() {
        this.content.node.active = false;
    }
    public async close() {
        
    }
    public makeFullScreen() {
        let uirect = this.content.node.getComponent(UITransform);
        uirect.contentSize = size(screen.width, screen.height);
    }
    public events(): Array<new (...args: any[]) => any> {
        return [];
    };
    public handle(arg: any): void {

    }
}
